class GoodsBean {
  String? goodsId;
  String? code;
  String? icon;
  String? type;
  int? subType;
  double? discount;
  double? originalPrice;
  double? price;
  int? exchangeCoin;
  int? originalExchangeCoin;
  double? originalPriceRupee;
  double? priceRupee;
  double? localPaymentPriceRupee;
  bool? isPromotion;
  double? localPayOriginalPrice;
  double? localPayPrice;
  String? tags;
  String? invitationId;

  GoodsBean({
    this.goodsId,
    this.code,
    this.icon,
    this.type,
    this.subType,
    this.discount,
    this.originalPrice,
    this.price,
    this.exchangeCoin,
    this.originalExchangeCoin,
    this.originalPriceRupee,
    this.priceRupee,
    this.localPaymentPriceRupee,
    this.isPromotion,
    this.localPayOriginalPrice,
    this.localPayPrice,
    this.tags,
  });

  GoodsBean.fromJson(Map<String, dynamic> json) {
    if (json["goodsId"] is String) {
      goodsId = json["goodsId"];
    }
    if (json["code"] is String) {
      code = json["code"];
    }
    if (json["icon"] is String) {
      icon = json["icon"];
    }
    if (json["type"] is String) {
      type = json["type"];
    }
    if (json["subType"] is num) {
      subType = (json["subType"] as num).toInt();
    }
    if (json["discount"] is num) {
      discount = (json["discount"] as num).toDouble();
    }
    if (json["originalPrice"] is num) {
      originalPrice = (json["originalPrice"] as num).toDouble();
    }
    if (json["price"] is num) {
      price = (json["price"] as num).toDouble();
    }
    if (json["exchangeCoin"] is num) {
      exchangeCoin = (json["exchangeCoin"] as num).toInt();
    }
    if (json["originalExchangeCoin"] is num) {
      originalExchangeCoin = (json["originalExchangeCoin"] as num).toInt();
    }
    if (json["originalPriceRupee"] is num) {
      originalPriceRupee = (json["originalPriceRupee"] as num).toDouble();
    }
    if (json["priceRupee"] is num) {
      priceRupee = (json["priceRupee"] as num).toDouble();
    }
    if (json["localPaymentPriceRupee"] is num) {
      localPaymentPriceRupee = (json["localPaymentPriceRupee"] as num).toDouble();
    }
    if (json["isPromotion"] is bool) {
      isPromotion = json["isPromotion"];
    }
    if (json["localPayOriginalPrice"] is num) {
      localPayOriginalPrice = (json["localPayOriginalPrice"] as num).toDouble();
    }
    if (json["localPayPrice"] is num) {
      localPayPrice = (json["localPayPrice"] as num).toDouble();
    }

    if (json["tags"] is String) {
      tags = json["tags"];
    }

    if (json["invitationId"] is String) {
      invitationId = json["invitationId"];
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> _data = <String, dynamic>{};
    _data["goodsId"] = goodsId;
    _data["code"] = code;
    _data["icon"] = icon;
    _data["type"] = type;
    _data["subType"] = subType;
    _data["discount"] = discount;
    _data["originalPrice"] = originalPrice;
    _data["price"] = price;
    _data["exchangeCoin"] = exchangeCoin;
    _data["originalExchangeCoin"] = originalExchangeCoin;
    _data["originalPriceRupee"] = originalPriceRupee;
    _data["priceRupee"] = priceRupee;
    _data["localPaymentPriceRupee"] = localPaymentPriceRupee;
    _data["isPromotion"] = isPromotion;
    _data["localPayOriginalPrice"] = localPayOriginalPrice;
    _data["localPayPrice"] = localPayPrice;
    _data["tags"] = tags;
    _data["invitationId"] = invitationId;
    return _data;
  }
}
